function jisuan(x) {
    // 
   let text = document.querySelector("#text");
   text.innerHTML = text.innerHTML+x;
}

function ans() {
    let text = document.querySelector("#text");
    alert( text.innerHTML+'的计算结果是'+eval(text.innerHTML));
    clear();
}

function clear() {
    document.querySelector("#text").innerHTML = '';
}

function cls(){
    clear();
}

function back(){
    let ele = document.querySelector("#text");
    ele.innerHTML = ele.innerHTML.substring(0,ele.innerHTML.length-1);
}

function sqrt(){
    let ele = document.querySelector("#text");
    alert(ele.innerHTML+'的开方是'+ Math.sqrt(parseInt(ele.innerHTML)));
    clear();
}

function sin(){
    let ele = document.querySelector("#text");
    alert(ele.innerHTML+'的正弦值是'+ Math.sin(parseInt(ele.innerHTML)));
    clear();
}

function cos(){
    let ele = document.querySelector("#text");
    alert(ele.innerHTML+'的余弦值值是'+ Math.cos(parseInt(ele.innerHTML)));
    clear();
}

function tan(){
    let ele = document.querySelector("#text");
    alert(ele.innerHTML+'的正交值是'+ Math.tan(parseInt(ele.innerHTML)));
    clear();
}

function cube(){
    let ele = document.querySelector("#text").innerHTML;
    alert(ele+'的立方是'+ (ele*ele*ele));
    clear();
}

function square(){
    let ele = document.querySelector("#text").innerHTML;
    alert(ele+'的平方是'+ (ele*ele));
    clear();
}

function jiechen2(x){
    if(x==0||x==1) return 1;
    return x*jiechen2(x-1);
}

function jiechen1() {
    let ele = document.querySelector("#text").innerHTML;
    let num = parseInt(ele);
    alert(ele+"的阶乘是"+ jiechen2(num));
    clear();
}